@import "../../themes/ionic.globals.md";

// Material Design Label
// --------------------------------------------------

/// @prop - Text color of the label
$label-md-text-color:                 #999 !default;

/// @prop - Text color of the label when it has focused
$label-md-text-color-focused:         color($colors-md, primary) !default;

/// @prop - Margin of the label
$label-md-margin:                     $item-md-padding-top ($item-md-padding-right / 2) $item-md-padding-bottom 0 !default;


// Material Design Default Label
// --------------------------------------------------

.label-md {
  margin: $label-md-margin;
}

[text-wrap] .label-md {
  font-size: $item-md-body-text-font-size;
  line-height: $item-md-body-text-line-height;
}

// Material Design Default Label Inside An Input/Select Item
// --------------------------------------------------

.item-input .label-md,
.item-select .label-md,
.item-datetime .label-md {
  color: $label-md-text-color;
}


// Material Design Stacked & Floating Labels
// --------------------------------------------------

.label-md[stacked] {
  font-size: 1.2rem;
}

.label-md[floating] {
  transform: translate3d(0, 27px, 0);
  transform-origin: left top;
  transition: transform 150ms ease-in-out;
}

.label-md[stacked],
.label-md[floating] {
  margin-bottom: 0;
  margin-left: 0;
}

.input-has-focus .label-md[stacked],
.input-has-focus .label-md[floating] {
  color: $label-md-text-color-focused;
}

.input-has-focus .label-md[floating],
.input-has-value .label-md[floating] {
  transform: translate3d(0, 0, 0) scale(.8);
}

.item-md.item-label-stacked [item-right],
.item-md.item-label-floating [item-right] {
  margin-top: $item-md-padding-media-top - 2;
  margin-bottom: $item-md-padding-media-bottom - 2;
}


// Generate Material Design Label colors
// --------------------------------------------------

@each $color-name, $color-base, $color-contrast in get-colors($colors-md) {

  .label-md-#{$color-name},
  .item-input .label-md-#{$color-name},
  .item-select .label-md-#{$color-name},
  .item-datetime .label-md-#{$color-name} {
    color: $color-base;
  }

}
